package com.swx.identityservice.models;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Table(name = "scbp_role")
@ApiModel(value = "角色实体类")
public class ScbpRole {
    /**
     * 角色Id
     */
    @Id
    @Column(name = "Id")
    @ApiModelProperty(value = "自增id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**
     * 所属部门id
     */
    @NotNull
    @ApiModelProperty(value = "部门id", example = "6")
    @Column(name = "AffiliatedDeptId")
    private Integer affiliateddeptid;

    /**
     * 所属单位id
     */
    @NotNull
    @ApiModelProperty(value = "单位id", example = "1")
    @Column(name = "AffiliatedUnitId")
    private Integer affiliatedunitid;


    @Transient
    private String nodetype;

    /**
     * 角色名称
     */
    @NotNull
    @ApiModelProperty(value = "角色名称", example = "处长")
    @Column(name = "Name")
    private String name;

//    @ApiModelProperty(value = "部门名称",example = "公诉一处")
//    @Column(name = "AffiliatedDept")
//    private String affiliateddept;

    @ApiModelProperty(value = "审核角色，仅做查询用", example = "王德刚")
//    @Column(name = "DealRole")
    @Transient
    private String dealrole;

    @ApiModelProperty(value = "单位名称", example = "高检院")
    @Transient
    @Column(name = "AffiliatedUnit")
    private String affiliatedunit;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "CreationTime")
    private Date creationtime;


    @Transient
    private List<ScbpRole> chileren = new ArrayList<>();


    public List<ScbpRole> getChileren() {
        return chileren;
    }

    public void setChileren(List<ScbpRole> chileren) {
        this.chileren = chileren;
    }


    @Column(name = "CreatorUserId")
    private Integer creatoruserid;


    @Column(name = "DeleterUserId")
    private Integer deleteruserid;


    @Column(name = "LastModificationTime")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastmodificationtime;


    @Column(name = "LastModifierUserId")
    private Integer lastmodifieruserid;

    @Column(name = "IsDeleted")
    private Boolean isdeleted;


    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "DeletionTime")
    private Date deletiontime;

    public String getNodetype() {
        return nodetype;
    }

    public void setNodetype(String nodetype) {
        this.nodetype = nodetype;
    }

    @Transient
    private Integer rid;

    @Transient
    private Integer did;

    @Transient
    private String rname;

    @Transient
    private String dtitle;


    @Transient
    private Integer drid;

    @Transient
    private String drname;

    @NotNull
    @Column(name = "DealRoleId")
    private Integer dealroleid;


    @Column(name = "RoleSort")
    private Integer rolesort;


    public void setId(Integer id) {
        this.id = id;
    }


    public String getName() {
        return name;
    }

    public Integer getRid() {
        return rid;
    }

    public void setRid(Integer rid) {
        this.rid = rid;
    }

    public void setName(String name) {
        this.name = name;
    }


    public Date getCreationtime() {
        return creationtime;
    }


    public void setCreationtime(Date creationtime) {
        this.creationtime = creationtime;
    }


    public Integer getCreatoruserid() {
        return creatoruserid;
    }


    public void setCreatoruserid(Integer creatoruserid) {
        this.creatoruserid = creatoruserid;
    }

    public Date getLastmodificationtime() {
        return lastmodificationtime;
    }


    public void setLastmodificationtime(Date lastmodificationtime) {
        this.lastmodificationtime = lastmodificationtime;
    }

    public Integer getLastmodifieruserid() {
        return lastmodifieruserid;
    }

    public void setLastmodifieruserid(Integer lastmodifieruserid) {
        this.lastmodifieruserid = lastmodifieruserid;
    }


    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Integer getDeleteruserid() {
        return deleteruserid;
    }

    public void setDeleteruserid(Integer deleteruserid) {
        this.deleteruserid = deleteruserid;
    }

    public Date getDeletiontime() {
        return deletiontime;
    }


    public void setDeletiontime(Date deletiontime) {
        this.deletiontime = deletiontime;
    }

    public Integer getDid() {
        return did;
    }

    public void setDid(Integer did) {
        this.did = did;
    }

    public String getRname() {
        return rname;
    }

    public void setRname(String rname) {
        this.rname = rname;
    }

    public String getDtitle() {
        return dtitle;
    }

    public void setDtitle(String dtitle) {
        this.dtitle = dtitle;
    }

    public Integer getDrid() {
        return drid;
    }

    public void setDrid(Integer drid) {
        this.drid = drid;
    }

    public String getDrname() {
        return drname;
    }

    public void setDrname(String drname) {
        this.drname = drname;
    }

    public Integer getAffiliateddeptid() {
        return affiliateddeptid;
    }

    public void setAffiliateddeptid(Integer affiliateddeptid) {
        this.affiliateddeptid = affiliateddeptid;
    }

    public Integer getAffiliatedunitid() {
        return affiliatedunitid;
    }

    public void setAffiliatedunitid(Integer affiliatedunitid) {
        this.affiliatedunitid = affiliatedunitid;
    }

    public Integer getDealroleid() {
        return dealroleid;
    }

    public void setDealroleid(Integer dealroleid) {
        this.dealroleid = dealroleid;
    }

    public Integer getRolesort() {
        return rolesort;
    }

    public Integer getId() {
        return id;
    }

//    public String getAffiliateddept() {
//        return affiliateddept;
//    }
//
//    public void setAffiliateddept(String affiliateddept) {
//        this.affiliateddept = affiliateddept;
//    }

    public String getDealrole() {
        return dealrole;
    }

    public void setDealrole(String dealrole) {
        this.dealrole = dealrole;
    }

    public String getAffiliatedunit() {
        return affiliatedunit;
    }

    public void setAffiliatedunit(String affiliatedunit) {
        this.affiliatedunit = affiliatedunit;
    }

    public void setRolesort(Integer rolesort) {
        this.rolesort = rolesort;
    }
}
